package org.ecshop.common.domain;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;


@Data
public class Result<T> {
	
	
	private String code ;
	
	private String msg ;
	
	private Boolean success ;
	
	private T  data ;
	
	private Map<String,String> details ;
	
	public Result() {
		
	}
	
	public Result(boolean success, String code ,String msg  ,boolean hasDetails ) {
		this.success = success;
		this.msg = msg;
		this.code = code ; 
		if( hasDetails )
			this.details = new HashMap<String,String>() ;
	}
	
	
	
	public Result(boolean success, String code ,String msg , T data ,boolean hasDetails) {
		this.success = success;
		this.msg = msg ;
		this.code = code ; 
		this.data = data ;
		if( hasDetails )
			this.details = new HashMap<String,String>() ;
	}
	

}
